{extend name="public/info_base"}

{block name="title"}
湖南省酒业协会 - 活动确认
{/block}

{block name="style"}
<link rel="stylesheet" href="__STATIC__/home/css/summary.css">
<link rel="stylesheet" href="__STATIC__/layui/css/layui.css">
<style>
    .layui-btn {
        margin-bottom: 20px;
    }
    @media screen and (max-width: 500px) {
        .main_detail {
            width: auto;
            font-size: 14px;
        }
    }
    .layui-input {
        height: 30px;
    }
</style>
{/block}

{block name="body"}
<div class="articleList-big">
    {include file="public/header" /}
    {include file="public/nav" /}
    {include file="public/banner" /}
    <div class="main">
        <div class="summary_lf">
            <ul>
                <li class="bg-9d">活动确认</li>

                <a href="" class="summary_a"><img src="__STATIC__/home/images/mao1.png" alt=""/></a>
                <a href="" class="summary_a"><img src="__STATIC__/home/images/mao1.png" alt=""/></a>
            </ul>
        </div>
        <div class="summary_rt">
            <div class="summary_rt_a">
                <div class="toRight"></div>
                <div class="summary_rt_top">
                    <span class="top_san"></span>
                    <span>当前位置 : </span>
                    <span>首页 </span>
                    <span class="cl-9d">&gt;  活动确认 </span>
                </div>
            </div>
            <!--常规-->
            <div class="top_two active">
                <span class="top_two_img"></span>
                <span class="cl-9d">活动确认</span>
            </div>
            <div class="main_detail">
                <div class="title">
                    <h2>{$data.title}</h2>
                </div>

                <div class="content">
                    <form class="layui-form" action="">
                        <div class="layui-form-item">
                            <label class="layui-form-label">单位：</label>
                            <div class="layui-input-inline">
                                <input type="text" name="enterprise" lay-verify="required" placeholder="单位名称" autocomplete="off" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">联系人：</label>
                            <div class="layui-input-inline">
                                <input type="text" name="linkman" lay-verify="required" autocomplete="off" placeholder="联系人姓名" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">职务：</label>
                            <div class="layui-input-inline">
                                <input type="text" name="duty" lay-verify="required" autocomplete="off" placeholder="公司职务" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">电话号码：</label>
                            <div class="layui-input-inline">
                                <input type="text" name="mobile" lay-verify="mobile" autocomplete="off" placeholder="联系电话" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <input type="hidden" name="activity_id" value="{$data.id}">
                                <button class="layui-btn" type="submit">立即提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <div class="clear"></div>
    {include file="public/footer" /}
</div>
<div class="articleList-little">
    <div class="articleList-little_top">
        <span>湖南酒业 </span>
        <span class="cl-9d">&gt;  活动确认 </span>
    </div>
    <div class="main_detail">
        <div class="title">
            <h2>
                {$data.title}
            </h2>
        </div>
        <div class="content">
            <form class="layui-form" action="">
                <div class="layui-form-item">
                    <label class="layui-form-label">单位：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="enterprise" lay-verify="required" placeholder="单位名称" autocomplete="off" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">联系人：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="linkman" lay-verify="required" autocomplete="off" placeholder="联系人姓名" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">职务：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="duty" lay-verify="required" autocomplete="off" placeholder="公司职务" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">电话号码：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="mobile" lay-verify="mobile" autocomplete="off" placeholder="联系电话" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <input type="hidden" name="activity_id" value="{$data.id}">
                        <button class="layui-btn" type="submit">立即提交</button>
                    </div>
                </div>
            </form>
        </div>

        <div style="width: 7rem; height:7rem; display: block; margin: 1rem auto;" >
            <img src="__STATIC__/home/images/top5.png"/>
        </div>
    </div>
</div>
{/block}

{block name="javascript"}
<script src="__STATIC__/layui/build/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
    $(function () {
        $('form').submit(function () {
            var send = 1;
            $(this).find('input[type="text"]').each(function (i, d) {
                if(!$(this).val()) {
                    $(this).val('').focus();
                    send = 0;
                    return false;
                }
                if($(this).attr('name') == 'mobile') {
                    if (!$(this).val().match(/^1[3|4|5|7|8][0-9]\d{4,8}$/i)) {
                        alert("手机号码格式不正确！");
                        $(this).focus();
                        send = 0;
                        return false;
                    }
                }
            });
            if (send == 0) {
                return false;
            }
            $.ajax({
                type : 'POST',
                url : '?',
                data : $(this).serialize(),
                dataType : 'json',
                success : function (msg) {
                    if (msg.code == 200) {
                        alert('提交成功');
                        window.history.back();
                    } else {
                        alert(msg.msg);
                    }
                }
            });
            return false;
        });
    });
</script>
{/block}